﻿using System;
using UnityEngine;
using UnityEngine.UI;

public class UserVerifyWidget : MonoBehaviour
{
    public Image idVerifyIconBg;
    public Image jobVerifyIconBg;
    public Image eduVerifyIconBg;
    public Text idVerifyText;
    public Text jobVerifyText;
    public Text eduVerifyText;
    public Image idVerifyIcon;
    public Image jobVerifyIcon;
    public Image eduVerifyIcon;
    public Image idCheckBg;
    public Image jobCheckBg;
    public Image eduCheckBg;
    public Color idActiveColor;
    public Color jobActiveColor;
    public Color eduActiveColor;
    public Color disactiveColor;
    public Color checkBgActiveColor;
    public Color checkBgDisactiveColor;
    public Color disactiveIconBGColor = Color.white;
    bool m_idVerified;
    bool m_jobVerified;
    bool m_eduVerified;
    public void Init(UserInfo userInfo)
    {
        m_idVerified = userInfo.realNameVerify;
        m_jobVerified = userInfo.jobVerify;
        m_eduVerified = userInfo.eduVerify;

        if (userInfo.realNameVerify)
        {
            idVerifyText.text = "实名已验证";
            idVerifyIcon.color = idActiveColor;
            idCheckBg.color = checkBgActiveColor;
        }
        else
        {
            idVerifyText.text = "实名未验证";
            idVerifyIcon.color = disactiveColor;
            idCheckBg.color = checkBgDisactiveColor;
            idVerifyIconBg.color = disactiveIconBGColor;
        }
        if (userInfo.jobVerify)
        {
            jobVerifyText.text = "工作已验证";
            jobVerifyIcon.color = jobActiveColor;
            jobCheckBg.color = checkBgActiveColor;
        }
        else
        {
            jobVerifyText.text = "工作未验证";
            jobVerifyIcon.color = disactiveColor;
            jobCheckBg.color = checkBgDisactiveColor;
            jobVerifyIconBg.color = disactiveIconBGColor;
        }
        if (userInfo.eduVerify)
        {
            eduVerifyText.text = "学历已验证";
            eduVerifyIcon.color = eduActiveColor;
            eduCheckBg.color = checkBgActiveColor;
        }
        else
        {
            eduVerifyText.text = "学历未验证";
            eduVerifyIcon.color = disactiveColor;
            eduCheckBg.color = checkBgDisactiveColor;
            eduVerifyIconBg.color = disactiveIconBGColor;
        }
    }

    public void OnClickIdVerify()
    {
        if (m_idVerified) return;

    }
    public void OnClickJobVerify()
    {
        if (m_jobVerified) return;

    }
    public void OnClickEduVerify()
    {
        if (m_eduVerified) return;

    }
}
